Primitive Class Vec2
Represents a 2D vector.
Members
x | (int) x coordinate |
y | (int) y coordinate |
Functions
Vec2:ToLength(length) | Modify this vector so that it becomes close to the requested length. |
Vec2(X, Y) | |
__tostring(Vec2) | Metafunction; use tostring(myVector) |
Members
Functions
- Vec2:ToLength(length)
-
Modify this vector so that it becomes close to the requested length.
Note that since the engine uses integers instead of floating-point numbers, this will be less accurate at smaller lengths.
Parameters:
- length float the new length to set the vector to.
- Vec2(X, Y)
-
Parameters:
- X int x coordinate
- Y int y coordinate
Returns:
-
Vec2
A Vec2 object.
- __tostring(Vec2)
-
Metafunction; use tostring(myVector)
Parameters:
- Vec2 Vec2 this Vec2
Returns:
-
string
A string showing the x, y, and z values of the Vec2